package com.qf.dao.impl;

import com.qf.dao.BindDao;
import com.qf.model.Card;
import com.qf.model.Navig;
import com.qf.utils.DruidUtil;
import org.springframework.jdbc.core.BeanPropertyRowMapper;
import org.springframework.jdbc.core.JdbcTemplate;

import java.util.List;

public class BindDaoImpl extends BaseDao implements BindDao {
    private JdbcTemplate jdbcTemplate=new JdbcTemplate(DruidUtil.getDataSource());
    @Override
    public int updateBind(String c_id) {
        String sql="update card set c_bind=1 where c_id=?";
        int num= jdbcTemplate.update(sql,c_id);
        return num;
    }



    public Card findBindById(String c_id){
        String sql = "select * from card where c_check = 1 and c_bind = 0 and c_id = ?";
        return queryForOne(Card.class,sql,c_id);
    }
}
